package com.fxm.controller;

import com.fxm.client.NoticeClient;
import com.fxm.returns.RespEntity;
import com.fxm.vo.param.NoticeParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 公告模块 前端控制器
 * </p>
 *
 * @author fxm
 * @since 2021-02-24
 */
@RestController
@RequestMapping("/notice")
@Slf4j
@Api(value = "公告模块", tags = "公告模块")
public class NoticeController {

    @Autowired
    private NoticeClient noticeClient;

    @GetMapping("/list")
    @ApiOperation(value = "公告列表")
    public RespEntity noticeList() {
        RespEntity respEntity = noticeClient.noticeList();
        return respEntity;
    }

    @PostMapping("/insert")
    @ApiOperation(value = "发布公告")
    public RespEntity insertNotice(NoticeParam noticeParam) {
        RespEntity respEntity = noticeClient.insertNotice(noticeParam);
        return respEntity;
    }
}
